package com.ruoyi.yf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yf.mapper.YfTruckMapper;
import com.ruoyi.yf.domain.YfTruck;
import com.ruoyi.yf.service.IYfTruckService;
import com.ruoyi.common.core.text.Convert;

/**
 * 医废车Service业务层处理
 * 
 * @author XiaoYi...
 * @date 2021-06-24
 */
@Service
public class YfTruckServiceImpl implements IYfTruckService 
{
    @Autowired
    private YfTruckMapper yfTruckMapper;

    /**
     * 查询医废车
     * 
     * @param truckId 医废车ID
     * @return 医废车
     */
    @Override
    public YfTruck selectYfTruckById(Long truckId)
    {
        return yfTruckMapper.selectYfTruckById(truckId);
    }

    /**
     * 查询医废车列表
     * 
     * @param yfTruck 医废车
     * @return 医废车
     */
    @Override
    public List<YfTruck> selectYfTruckList(YfTruck yfTruck)
    {
        return yfTruckMapper.selectYfTruckList(yfTruck);
    }

    /**
     * 新增医废车
     * 
     * @param yfTruck 医废车
     * @return 结果
     */
    @Override
    public int insertYfTruck(YfTruck yfTruck)
    {
        yfTruck.setCreateTime(DateUtils.getNowDate());
        return yfTruckMapper.insertYfTruck(yfTruck);
    }

    /**
     * 修改医废车
     * 
     * @param yfTruck 医废车
     * @return 结果
     */
    @Override
    public int updateYfTruck(YfTruck yfTruck)
    {
        yfTruck.setUpdateTime(DateUtils.getNowDate());
        return yfTruckMapper.updateYfTruck(yfTruck);
    }

    /**
     * 删除医废车对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYfTruckByIds(String ids)
    {
        return yfTruckMapper.deleteYfTruckByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医废车信息
     * 
     * @param truckId 医废车ID
     * @return 结果
     */
    @Override
    public int deleteYfTruckById(Long truckId)
    {
        return yfTruckMapper.deleteYfTruckById(truckId);
    }

    @Override
    public String selectTagCount(String ids) {

        return yfTruckMapper.selectTagCount(ids);
    }
}
